#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <fstream>
#include <set>

using namespace std;

int getBitCount(unsigned int num)
{
    int count = 0;
    while (num > 0) {
	num = num&(num-1);
    }
    return count;
}

vector<int> getMin(int a[], int size)
{
    vector<int> ans;
    priority_queue<int, vector<int>, greater<int> > pq;
    for (unsigned int i = 1; i < (1 << size); i++) {
	if (getBitCount(i) > 3) continue;	
	int sum = 0;
	for (int j = 0; j < size; j++) {
	    if (i & (1 << j)) sum += a[j];
	}
	pq.push(sum);
    } 
    for (int i = 0; i < 10; i++) {
	ans.push_back(pq.top());
	pq.pop();
    }
    return ans;	
}

int main(int argc, char **argv)
{
    int a[] = {3,4,5,15,19,20,25};
    vector<int> ans = getMin(a, sizeof(a)/sizeof(int));
    for (int i = 0; i < 10; i++)
	cout << ans[i] << " ";
}
